# -*- coding:utf8 -*-
__author__ = 'Forcs'

class AppHeader(object):

    def __init__(self, meta):
        self._version = meta["HTTP_APP_VERSION"]
        self._id = meta["HTTP_APP_ID"]
        self._flavor = meta["HTTP_APP_FLAVOR"]
        self._platform = meta["HTTP_APP_PLATFORM"]
        self._model = meta["HTTP_APP_MODEL"]
        self._product = meta["HTTP_APP_PRODUCT"]
        self._user_agent = meta["HTTP_APP_USERAGENT"]
        self._serial = meta["HTTP_APP_SERIAL"]
        self._stb = meta["HTTP_APP_STB"]
        self._sys_ver = meta["HTTP_APP_SYSTEM_VER"]
        self._mac_addr = meta["HTTP_APP_MAC_ADDR"]

    @property
    def app_version(self):
        return self._version

    @property
    def app_id(self):
        return self._id

    @property
    def app_flavor(self):
        return self._flavor

    @property
    def app_platform(self):
        return self._platform

    @property
    def app_model(self):
        return self._model

    @property
    def app_product(self):
        return self._product

    @property
    def app_user_agent(self):
        return self._user_agent

    @property
    def app_serial(self):
        return self._serial

    @property
    def app_stb(self):
        return self._stb

    @property
    def app_sys_ver(self):
        return self._sys_ver

    @property
    def app_mac_addr(self):
        return self._mac_addr

def get_app_header(request):
    """
    获取客户端的请求header
    """
    meta = request.META
    return AppHeader(meta)
